﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Microsoft.Data.Schema.ScriptDom.Sql;
using System.Linq;
using System.Text;

namespace Neznayka
{
    public class SQLExpressionDependency
    {
        private Literal _variable;
        private List<Literal> _dependencies;

        #region ctor
        public SQLExpressionDependency()
        {
            _variable = new Literal();
            _dependencies = new List<Literal>();
        }
        public SQLExpressionDependency(Literal _variable1)
        {
            _variable = _variable1;
            _dependencies = new List<Literal>();
        }
        #endregion

        #region properties
        public Literal Variable
        {
            set { _variable = value; }
            get { return _variable;  }
        }

        public ReadOnlyCollection<Literal> Dependencies
        {
            //set { _dependencies = value; } // not used - yet - remove
            get { return _dependencies.AsReadOnly(); } 
        }
        #endregion

        #region methods

        public void addDependency(Literal variable)
        {
            _dependencies.Add(variable);
            return ;
        }
        public void addDependencies(List<Literal> variables)
        {
            _dependencies.AddRange(variables);
            return;
        }

        #endregion

    }
}

